<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>项目列表</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="${basePath}/frame/layui/css/layui.css"  media="all">

</head>

<body>
<input type="button" class="layui-btn layui-btn-warm" style="float:right;margin: 5px;" value="添加项目" onclick="addProject()">
	<table class="layui-table" lay-even lay-skin="nob">
  <colgroup>
    <col width="150">
    <col width="200">
    <col>
  </colgroup>
  <thead>
    <tr>
      <th>项目名称</th>
      <th>协议</th>
      <th>ip</th>
      <th>端口</th>
      <th>描述</th>
    </tr> 
  </thead>
  <tbody id="project">
   
  </tbody>
</table>
<script type="text/javascript" src="${basePath}/js/jquery-1.4.4.min.js"></script>
<script src="${basePath}/frame/layui/lay/dest/layui.all.js" charset="utf-8"></script>
<script type="text/javascript">

$(function(){
	 $.ajax({
         type: "POST",
         url: "${basePath}/project/getProjectLists",
         dataType: "json",
         success: function(data){
         	if(data.isSuccess){
    			var html="";
         		$.each(data.data,function(i,item){
         			if((i%2)==0){
         		　　　html+="<tr>";
         			}else{
         				html+="<tr style='background:#e2e2e2;'>";
             		}
         		   	  html+="<a ><td>"+item.projectName+"</td></a>";
         		   	  html+="<td>"+item.protocol+"</td>";
         		      html+="<td>"+item.ip+"</td>";
         		      html+="<td>"+item.protocol+"</td>";
         		      html+="<td>"+item.describe+"</td>";
         		      html+="<tr>";
         		　　});
         		
         		$("#project").append(html);
         	}else{
         		alert("暂无数据");
         	}
         },
         error: function(data){
        	 alert("网络错误！");
         }
     });
})
function addProject(){
	window.location.href="${basePath}/project/addProjectPage";
}
</script>

</body>
</html>